home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’97 / MacMolecule2 a la Breakout / MacHack.c / Jetsons.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-06-28  |  1.0 KB  |  59 lines  |  [TEXT/CWIE]

  1. #define BALLSIZE 7
  2. #define BALLSIZEHALF 3
  3. #define PADDSIZE 41 /* odd for center */
  4. #define PADDSIZEHALF 20
  5. #define DISTANCE 1
  6.  
  7. enum {
  8.   SPACE = 49,
  9.   UP_ARROW = 126,
  10.   DOWN_ARROW = 125,
  11.   LEFT_ARROW = 123,
  12.   RIGHT_ARROW = 124
  13. };
  14.  
  15. enum {
  16.   STARTUP,
  17.   PLAYING,
  18.   PAUSED,
  19.   OVER
  20. };
  21.  
  22. enum {
  23.   STATIONARY,
  24.   CLOCKWISE,
  25.   COUNTERCLOCKWISE
  26. };
  27.  
  28. typedef struct {
  29.     WindowPtr theWindow;
  30.       
  31.   int state;
  32.   int paddx;
  33.   int paddy;
  34.   
  35.   int ballx;
  36.   int bally;
  37.  
  38.   int balldx;
  39.   int balldy;    
  40.   
  41.   int color;
  42.   
  43.   int score;
  44.   
  45. } GameState;
  46.  
  47. void GetGameRect(WindowPtr theWindow, Rect *gameRect);
  48. void GameInit(GameState *game);
  49. void GameStartup(GameState *game, Rect *gameRect, WindowPtr theWindow);
  50. void GamePlaying(GameState *game, Rect *gameRect);
  51. void GameMain(WindowPtr theWindow);
  52. void DrawGame(GameState *game, Rect *gameRect);
  53.  
  54. void MoleculeSunRise(void);
  55. void MovePaddleClockwise(GameState *game, Rect * gameRect);
  56. void MovePaddleCounterClockwise(GameState *game, Rect * gameRect);
  57. long LeftArrowKeyIsDown(void);
  58. long KeyIsDown(int KeyNum);
  59.